/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="department_position")
public class Department_position implements Serializable {
	public Department_position() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Department department;
	
	private cn.imvc.app.entities.Position position;
	
	private java.util.Set user = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_DEPARTMENT_POSITION_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_DEPARTMENT_POSITION_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	public void setUser(java.util.Set value) {
		this.user = value;
	}
	
	@ManyToMany(targetEntity=cn.imvc.app.entities.User.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@JoinTable(name="user_department_position", joinColumns={ @JoinColumn(name="department_positionid") }, inverseJoinColumns={ @JoinColumn(name="userid") })	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getUser() {
		return user;
	}
	
	
	public void setDepartment(cn.imvc.app.entities.Department value) {
		this.department = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Department.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="department_id", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	@org.hibernate.annotations.Index(name="FKdepartment981528")	
	public cn.imvc.app.entities.Department getDepartment() {
		return department;
	}
	
	public void setPosition(cn.imvc.app.entities.Position value) {
		this.position = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Position.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="position_id", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	@org.hibernate.annotations.Index(name="FKdepartment185896")	
	public cn.imvc.app.entities.Position getPosition() {
		return position;
	}
	
	public String toString() {
		return String.valueOf(getId());
	}
	
}
